package list;

import java.util.HashSet;

public class demo5 {
	public static void main(String[] args) {
		HashSet<Person> set = new HashSet<>();
		Person p1 = new Person("aaa",12);
		Person p2 = new Person("aaa",12);
		Person p3 = new Person("bbb",13);
		
		System.out.println(p1.hashCode());
		System.out.println(p2.hashCode());
		System.out.println(p1==p2);//地址
		System.out.println(p1.equals(p2));//值
		
		set.add(p1);
		set.add(p2);
		set.add(p3);
		
		System.out.println(set);
		
		
	}

}
